#include <iostream>
#include <string>
using namespace std;
int main()
{
	string s1, s2, ret = "";
	getline(cin, s1);
	getline(cin, s2);
    int hash[256] = {0};
    for(auto& e : s2)
    {
        hash[e]++;
    }
    for(auto& e : s1)
    {
        if(hash[e] == 0)
        {
            ret += e;
        }
    }
    cout << ret << endl;
	return 0;
}